package com.xmtlxx.oms.mapper;

import com.xmtlxx.oms.domain.Task;
import com.xmtlxx.oms.domain.TaskDtl;
import com.xmtlxx.oms.domain.bo.TaskBo;
import com.xmtlxx.oms.domain.bo.TaskDtlBo;
import com.xmtlxx.oms.domain.vo.TaskDtlExportVo;
import com.xmtlxx.oms.domain.vo.TaskDtlVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 出入库订单明细Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-12
 */
public interface TaskDtlMapper extends BaseMapperPlus<TaskDtlMapper, TaskDtl, TaskDtlVo> {

    /**
     * 根据条件分页查询出入库订单明细
     *
     * @param taskDtl 出入库订单明细
     * @return Page TaskDtl
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "t.create_by"),
        @DataColumn(key = "deptName", value = "t.dept_id"),
        @DataColumn(key = "userName", value = "t.create_by")
    })
    Page<TaskDtlVo> selectPageTaskDtlList(@Param("page") Page<TaskDtl> page,@Param("taskDtl") TaskDtlBo taskDtl);

    /**
     * 查询出入库订单明细列表
     *
     * @param taskDtl 出入库订单明细
     * @return 出入库订单明细集合
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "t.create_by"),
//        @DataColumn(key = "deptName", value = "t.dept_id"),
//        @DataColumn(key = "userName", value = "t.create_by")
//    })
    List<TaskDtlVo> selectTaskDtlList(@Param("taskDtl") TaskDtlBo taskDtl);

    TaskDtlVo selectTaskDtlVoByID(String id);

    List<TaskDtlVo> taskDtlDeptList();

    List<TaskDtlVo> getDtlPropertyClassify(Long deptId);

    List<TaskDtl> selectTaskDtl(@Param("taskDtl") TaskDtlBo taskDtl);

    void deleteByDtlId(String id);

    int updateTaskDtl(@Param("taskDtl") TaskDtl taskDtl);

    int updateTaskDtlBatchById(@Param("list") List<TaskDtl> taskDtls);

    List<TaskDtlExportVo> queryExportList(@Param("task") TaskBo bo);

    List<Task> getAllRePlaceTask();

}
